Optimal. Leaf size=97 \[ \frac {2 (a c-b d) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} f}+\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {2833, 12, 2739,
632, 210} \begin {gather*} \frac {2 (a c-b d) \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (e+f x)\right )+b}{\sqrt {a^2-b^2}}\right )}{f \left (a^2-b^2\right )^{3/2}}+\frac {(b c-a d) \cos (e+f x)}{f \left (a^2-b^2\right ) (a+b \sin (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 2739
Rule 2833
Rubi steps
\begin {align*} \int \frac {c+d \sin (e+f x)}{(a+b \sin (e+f x))^2} \, dx &=\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {\int \frac {-a c+b d}{a+b \sin (e+f x)} \, dx}{-a^2+b^2}\\ &=\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {(a c-b d) \int \frac {1}{a+b \sin (e+f x)} \, dx}{a^2-b^2}\\ &=\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f}\\ &=\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}-\frac {(4 (a c-b d)) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f}\\ &=\frac {2 (a c-b d) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} f}+\frac {(b c-a d) \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.35, size = 96, normalized size = 0.99 \begin {gather*} \frac {\frac {2 (a c-b d) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {(b c-a d) \cos (e+f x)}{(a-b) (a+b) (a+b \sin (e+f x))}}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 144, normalized size = 1.48
method | result | size |
derivativedivides | \(\frac {\frac {-\frac {2 b \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) a}-\frac {2 \left (a d -b c \right )}{a^{2}-b^{2}}}{a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a}+\frac {2 \left (a c -b d \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{2}-b^{2}\right )^{\frac {3}{2}}}}{f}\) | \(144\) |
default | \(\frac {\frac {-\frac {2 b \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) a}-\frac {2 \left (a d -b c \right )}{a^{2}-b^{2}}}{a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+a}+\frac {2 \left (a c -b d \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{2}-b^{2}\right )^{\frac {3}{2}}}}{f}\) | \(144\) |
risch | \(\frac {2 i \left (a d -b c \right ) \left (i b +a \,{\mathrm e}^{i \left (f x +e \right )}\right )}{b \left (a^{2}-b^{2}\right ) f \left (-i b \,{\mathrm e}^{2 i \left (f x +e \right )}+i b +2 a \,{\mathrm e}^{i \left (f x +e \right )}\right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) a c}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) a c}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b d}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}\) | \(396\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 414, normalized size = 4.27 \begin {gather*} \left [-\frac {{\left (a^{2} c - a b d + {\left (a b c - b^{2} d\right )} \sin \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}\right ) - 2 \, {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \cos \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f\right )}}, -\frac {{\left (a^{2} c - a b d + {\left (a b c - b^{2} d\right )} \sin \left (f x + e\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (f x + e\right )}\right ) - {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \cos \left (f x + e\right )}{{\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 157, normalized size = 1.62 \begin {gather*} \frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (a c - b d\right )}}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} + \frac {b^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a b d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a b c - a^{2} d}{{\left (a^{3} - a b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a\right )}}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.02, size = 215, normalized size = 2.22 \begin {gather*} \frac {2\,\mathrm {atan}\left (\frac {\left (\frac {2\,\left (a^2\,b-b^3\right )\,\left (a\,c-b\,d\right )}{{\left (a+b\right )}^{3/2}\,\left (a^2-b^2\right )\,{\left (a-b\right )}^{3/2}}+\frac {2\,a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,c-b\,d\right )}{{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}\right )\,\left (a^2-b^2\right )}{2\,\left (a\,c-b\,d\right )}\right )\,\left (a\,c-b\,d\right )}{f\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {\frac {2\,\left (a\,d-b\,c\right )}{a^2-b^2}+\frac {2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d-b\,c\right )}{a\,\left (a^2-b^2\right )}}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________